#!/boot/home/config/bin/perl -w

# This script will convert the selected plain text
# to the HTML text with Perl.
# If there's no selection, nothing will be done.

open TMP, "$ENV{'TMPFILE'}";
while(<TMP>){
	s/&/&amp;/g;
	s/</&lt;/g;
	s/>/&gt;/g;
	s/\"/&quot;/g;
	s/\n/<BR>\n/g;
	s/\t/&nbsp;&nbsp;&nbsp;&nbsp;/g;
	s/(.*)((http|ftp):\/\/[a-zA-Z0-9\/~?_.@=\-#&%]+)(.*)/$1<A HREF=\"$2\">$2<\/A>$4/g;
	
	print;
}
close TMP;